<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/9
 * Time: 9:09
 */
/**
 * PHP实现支持GET,POST,Multipart/form-data的HTTP请求类 httpRequest测试
 */
header("Content-Type:text/html;charset=utf-8");
require_once 'HttpRequest.php';

$httpRequestObj = new HttpRequest();

$config = array(
//    'ip' => '192.168.101,236',
    'ip' => '127.0.0.1',
    'host' => 'http://localhost',
    'url' => 'http://localhost/study/http/get.php',
    'errno' => '',
    'errstr' => ''

);

$httpRequestObj->setConfig($config);
$formData = array('name' => 'jinzhimei', 'gender' => 'man');
$fileData = array(    array(      'name' => 'photo',      'filename' => '2.jpg',      'path' => '2.jpg'   )  );
$httpRequestObj->setFormData($formData);
$httpRequestObj->setFileData($fileData);
$res=$httpRequestObj->send('multipart');
print_r($res);